home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
138
/
138.xpi
/
chrome
/
stumbleupon.jar
/
content
/
sendDialog.xul
< prev
next >
Wrap
Extensible Markup Language
|
2009-05-22
|
3KB
|
98 lines
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://stumbleupon/locale/stumbleupon.dtd" >
<dialog id="stumble_send_dialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="StumbleUpon Send"
buttons="accept,cancel"
ondialogaccept="return handle_accept();"
ondialogcancel="return handle_cancel();"
onload="init()">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_stumble" src="chrome://stumbleupon/locale/stumbleupon.properties"/>
</stringbundleset>
<script type="application/x-javascript">
<![CDATA[
var detail;
var textbox;
detail = window.arguments[0];
document.getElementById("stumble_send_dialog").setAttribute("title", detail.dialog_title);
function init()
{
// Creating elements programatically works around a Firefox bug
// related to setting the title attribute (ref: Firefox 1.5, XP).
// -- JW
var dialog = document.getElementById("stumble_send_dialog");
dialog.getButton("accept").label = "Send";
var grid = document.createElement("grid");
dialog.appendChild(grid);
var columns = document.createElement("columns");
grid.appendChild(columns);
var el;
el = document.createElement("column");
columns.appendChild(el);
el = document.createElement("column");
columns.appendChild(el);
var rows = document.createElement("rows");
grid.appendChild(rows);
var row;
if (detail.show_target)
{
row = document.createElement("row");
rows.appendChild(row);
el = document.createElement("label");
el.setAttribute("value", "To:");
el.setAttribute("style", "font-weight: bold; text-align: right;");
row.appendChild(el);
el = document.createElement("label");
el.setAttribute("value", detail.target);
row.appendChild(el);
}
row = document.createElement("row");
rows.appendChild(row);
el = document.createElement("label");
el.setAttribute("value", "Subject:");
el.setAttribute("style", "font-weight: bold;");
row.appendChild(el);
var display_url = detail.display_url;
if (display_url.length > 50)
{
display_url = display_url.substr(0, 50) + "...";
}
el = document.createElement("label");
el.setAttribute("value", display_url);
row.appendChild(el);
textbox = document.createElement("textbox");
textbox.setAttribute("id", "message");
textbox.setAttribute("multiline", "false");
textbox.setAttribute("style", "width: 300px;");
dialog.appendChild(textbox);
}
function handle_accept()
{
detail.message = textbox.value;
opener.setTimeout(function (parent, detail) { parent.su_handle_send_dialog_accept(detail); }, 0, opener, detail);
}
function handle_cancel()
{
opener.setTimeout(function (parent) { parent.su_invoke_global_event("refresh-referral-menu", null); }, 0, opener);
}
]]>
</script>
</dialog>